package cc.beup.common.util;

import java.util.Collection;
import java.util.Map;
import java.util.Objects;

/**
 * @Author Byron Bai
 * @Date 2021/4/18 15:58
 * @Description:
 */
public class CollectionUtil {

    private CollectionUtil() {
    }

    /**
     * 集合判非空
     *
     * @Author: Byron Bai
     * @Date: 2021/4/18 16:06
     */
    public static boolean isNotEmpty(Collection list) {
        return !isEmpty(list);
    }

    /**
     * 集合判空
     *
     * @Author: Byron Bai
     * @Date: 2021/4/18 16:08
     */
    public static boolean isEmpty(Collection list) {
        return Objects.isNull(list) || list.isEmpty();
    }

    /**
     * Map判非空
     *
     * @Author: Byron Bai
     * @Date: 2021/4/18 16:08
     */
    public static boolean isNotEmpty(Map map) {
        return !isEmpty(map);
    }

    /**
     * Map判空
     *
     * @Author: Byron Bai
     * @Date: 2021/4/18 16:08
     */
    public static boolean isEmpty(Map map) {
        return Objects.isNull(map) || map.isEmpty();
    }

}